import request from '@/utils/request'

export const getInfoApi = (params) => {
    // 模拟数据返回
    return new Promise((resolve, reject) => {
        return resolve(
            [
                {name:'liu',age: 18},
                {name:'liu1',age: 19},
            ]
        )
    })
    // return request({
    //     url: '/apin/commodit/info',
    //     method: 'get',
    //     params
    // })
}
// 上传cad图
export const uploadCad = (data) => {
    return request({
        url: '/arch/cad/uploadCad',
        method: 'post',
        headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
        data
    })
}

// 保存cad图到对应的项目下
export const saveCadFile = (data) => {
    return request({
        url: '/arch/cad/projectFile/saveCadFile',
        method: 'post',
        headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
        data
    })
}

// 查询项目列表
export const queryProjects = (data) => {
    return request({
        url: '/arch/cad/project/listCadProject',
        method: 'post',
        data
    })
}

// 查询项目下的cad图纸列表
export const queryProjCADInfo = (data) => {
    return request({
        url: '/arch/cad/projectFile/listCadFile',
        method: 'post',
        data
    })
}

// 查询图纸的坐标信息
export const queryCADFileInfo = (data) => {
    return request({
        url: '/arch/cad/projectEntity/listCadEntity',
        method: 'post',
        data
    })
}

// 新建、保存项目
export const saveProject = (data) => {
    return request({
        url: '/arch/cad/project/saveCadProject',
        method: 'post',
        data
    })
}

// 删除项目
export const deleteProject = (data) => {
    return request({
        url: '/arch/cad/project/deleteCadProject',
        method: 'post',
        data
    })
}

// 删除图纸 
export const deleteCadFile = (data) => {
    return request({
        url: '/arch/cad/projectFile/deleteCadFile',
        method: 'post',
        data
    })
}

// 获取楼面板的坐标点
export const computeCadFloor = (data) => {
    return request({
        url: 'arch/cad/projectEntity/computeCadFloor',
        method: 'post',
        data
    })
}

// 楼面模板
export const autoCadFloorTemplate = (data) => {
    return request({
        url: 'arch/cad/projectEntity/autoCadFloorTemplate',
        method: 'post',
        data
    })
}